home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 52 / Amiga Format AFCD52 (Issue 136, May 2000).iso / -serious- / programming / c / stormamiga_lib-v45_00d / include / unistd.h < prev    next >
C/C++ Source or Header  |  2000-02-28  |  2KB  |  82 lines

  1. #ifndef UNISTD_H
  2. #define UNISTD_H
  3.  
  4. /*
  5. **          $VER: unistd.h 1.7 (31.10.99)
  6. **             Includes Release 45.00
  7. **
  8. **    Copyright © 1996/2000 by CyberdyneSystems
  9. **
  10. **            written by Matthias Henze
  11. **               All Rights Reserved
  12. */
  13.  
  14. #ifndef STORMAMIGA_H
  15.   #include <stormamiga.h>
  16. #endif
  17. #ifndef SYS_TYPES_H
  18.   #include <sys/types.h>
  19. #endif
  20. #ifndef SYS_UNISTD_H
  21.   #include <sys/unistd.h>
  22. #endif
  23. #ifndef _INCLUDE_STDIO_H
  24.   #include <stdio.h>
  25. #endif
  26.  
  27. #ifdef __cplusplus
  28.   extern "C" {
  29. #endif
  30.  
  31. #define STDIN_FILENO    0       /* standard input file descriptor */
  32. #define STDOUT_FILENO   1       /* standard output file descriptor */
  33. #define STDERR_FILENO   2       /* standard error file descriptor */
  34.  
  35.  
  36. /*----- ANSI C-functions -----*/
  37.  
  38. char    *getcwd (char *, size_t);
  39.  
  40. /*----- UNIX-functions -----*/
  41.  
  42. int     rmdir   (cchar *);
  43. void    sleep   (uint);
  44. int     unlink  (cchar *);
  45.  
  46. #ifndef _POSIX_SOURCE
  47.   char    *getwd  (char *);
  48.   char    *mktemp (char *);
  49.   void    usleep  (uint);
  50. #endif
  51.  
  52. /*----- POSIX-functions -----*/
  53.  
  54. int     access  (cchar *, int);
  55. int     chdir   (cchar *);
  56. int     close   (int);
  57. off_t   lseek   (int, off_t, int);
  58. ssize_t read    (int, void *, size_t);
  59. ssize_t write   (int, cvoid *, size_t);
  60.  
  61. #ifdef __cplusplus
  62.   }
  63. #endif
  64.  
  65. #ifdef STORMAMIGA_UNIXPATH
  66.   __inline int access_u (cchar *file, int mode)
  67.   { return access       (file, mode); }
  68.  
  69.   __inline int chdir_u  (cchar *path)
  70.   { return chdir        (path); }
  71.  
  72.   __inline int rmdir_u  (cchar *path)
  73.   { return rmdir        (path); }
  74.  
  75.   #define access(file, mode)  access_u(UnixToAmigaPath(file), mode)
  76.   #define chdir(path)         chdir_u(UnixToAmigaPath(path))
  77.   #define rmdir(path)         rmdir_u(UnixToAmigaPath(path))
  78.   #define unlink(path)        rmdir_u(UnixToAmigaPath(path))
  79. #endif
  80.  
  81. #endif /* UNISTD_H */
  82.